package com.cvr.project.repertory;

import androidx.lifecycle.LiveData;

import com.cvr.project.entity.ORCEntity;
import com.cvr.project.utils.RetrofitUtils;
import com.cvr.project.entity.IDCardEntity;

import java.io.File;
import java.util.ArrayList;
import java.util.List;

import okhttp3.MultipartBody;

/**
 * _ooOoo_
 * o8888888o
 * 88" . "88
 * (| -_- |)
 * O\ = /O
 * ____/`---'\____
 * .   ' \\| |// `.
 * / \\||| : |||// \
 * / _||||| -:- |||||- \
 * | | \\\ - /// | |
 * | \_| ''\---/'' | |
 * \ .-\__ `-` ___/-. /
 * ___`. .' /--.--\ `. . __
 * ."" '< `.___\_<|>_/___.' >'"".
 * | | : `- \`.;`\ _ /`;.`/ - ` : | |
 * \ \ `-. \_ __\ /__ _/ .-` / /
 * ======`-.____`-.___\_____/___.-`____.-'======
 * `=---='
 * .............................................
 * 佛祖保佑             永无BUG
 *
 * @author :created by master
 * time :2021/7/7
 * 描述：网络请求
 */
public class DataRepository extends BaseRepository {
    private static DataRepository instance = new DataRepository();

    public static DataRepository getInstance() {
        return instance;
    }

    //身份证登录
    public LiveData<BaseResponse<IDCardEntity>> icCardLogin(String families_id, String phone) {
        return request(RetrofitUtils.instanceApi().icCardLogin(families_id, phone)).get();
    }

    //人脸登录，截取摄像头人脸图片
    public LiveData<BaseResponse<ORCEntity>> icOrcLogin(List<MultipartBody.Part> file) {
        return request(RetrofitUtils.instanceApi().icOrcLogin(file)).get();
    }
}